var app = angular.module("login", [ "ngCookies", "constApp" ]);
app.controller("loginContraller", function($scope, $http, $cookieStore,
                                               $templateCache,$const) {


    $scope.phoneCheck=function(){
        $http({
            url : URL+'oltuservice/retrieve/password',
            method : 'POST' ,
            dataType : "json" ,
            params : { phone : $scope.phone}
        }).success(function(data ){
                $scope.check=true;
            }
        )
    }

    $scope.pack=function() {
        if ($scope.check) {
            $http({
                url: URL + "oltuservice/retrieve/check/password",
                method: 'POST',
                dataType: "json",
                params: {phone: $scope.phone, checkNumber: $scope.number}
            }).success(function (data) {
                $cookieStore.put("settingPassword", true);
                $cookieStore.put("phone",$scope.phone);
                location.href = "settingPassword.html"
            })
        }
    }
})

